package dtos;

import java.io.Serializable;
import java.util.Date;

public class LeaveDTO implements Serializable{


    private int id;
    private int user;
    private Date from;
    private Date until;
    private String reason;
    private int type;
    private int status;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUser() {
        return user;
    }

    public void setUser(int user) {
        this.user = user;
    }

    public Date getFrom() {
        return from;
    }

    public void setFrom(Date from) {
        this.from = from;
    }

    public Date getUntil() {
        return until;
    }

    public void setUntil(Date until) {
        this.until = until;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LeaveDTO leaveDTO = (LeaveDTO) o;

        if (id != leaveDTO.id) return false;
        if (status != leaveDTO.status) return false;
        if (type != leaveDTO.type) return false;
        if (user != leaveDTO.user) return false;
        if (from != null ? !from.equals(leaveDTO.from) : leaveDTO.from != null) return false;
        if (reason != null ? !reason.equals(leaveDTO.reason) : leaveDTO.reason != null) return false;
        if (until != null ? !until.equals(leaveDTO.until) : leaveDTO.until != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + user;
        result = 31 * result + (from != null ? from.hashCode() : 0);
        result = 31 * result + (until != null ? until.hashCode() : 0);
        result = 31 * result + (reason != null ? reason.hashCode() : 0);
        result = 31 * result + type;
        result = 31 * result + status;
        return result;
    }

    @Override
    public String toString() {
        return "LeaveDTO{" +
                "id=" + id +
                ", user=" + user +
                ", type=" + type +
                '}';
    }
}
